how to secureErase your disk with diskutil

  1. on macOS

    man diskutil
    

    NOTE: This kind of secure erase is no longer considered safe. Modern devices have wear-leveling, block-sparing, and possi- bly-persistent cache hardware, which cannot be completely erased by these commands. The modern solution for quickly and securely erasing your data is encryption. Strongly-encrypted data can be instantly “erased” by destroying (or losing) the key (password), because this renders your data irretrievable in practical terms. Consider using APFS encryption (File- Vault).

    Level should be one of the following:

    o 0 - Single-pass zero-fill erase.

    o 1 - Single-pass random-fill erase.

    o 2 - US DoD 7-pass secure erase.

    o 3 - Gutmann algorithm 35-pass secure erase.

    o 4 - US DoE algorithm 3-pass secure erase.

    diskutil list
    diskutil secureErase 2 /dev/disk2
    
  2. on otherOS

    create a bootable usb drive with unibeast, boot computer from usb drive like macOS’s command+R.